<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
<title></title>
</head>
<body>
<script type="text/javascript">
    var year = 2021;
    var result = (year%4 == 0 && year%100 != 0) || (year%400 == 0)?29:28;
    alert(year+"年2月有"+result+"天");
</script>
</body>
</html>
